All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class com.sun.java.swing.DefaultBoundedRangeModel

java.lang.Object
   |
   +----com.sun.java.swing.DefaultBoundedRangeModel

public class DefaultBoundedRangeModel
extends Object
implements BoundedRangeModel, Serializable
A generic implementation of BoundedRangeModel.

Warning: serialized objects of this class will not be compatible with future swing releases. The current serialization support is appropriate for short term storage or RMI between Swing1.0 applications. It will not be possible to load serialized Swing1.0 objects with future releases of Swing. The JDK1.2 release of Swing will be the compatibility baseline for the serialized form of Swing objects.

See Also:
BoundedRangeModel

Variable Index

 o changeEvent
Only one ChangeEvent is needed per model instance since the event's only (read-only) state is the source property.
 o listenerList

Constructor Index

 o DefaultBoundedRangeModel()
Initializes all of the properties as follows:
 o DefaultBoundedRangeModel(int, int, int, int)
Initializes value, extent, minimum and maximum.

Method Index

 o addChangeListener(ChangeListener)
Adds a ChangeListener.
 o fireStateChanged()
Run each ChangeListeners stateChanged() method.
 o getExtent()
 o getMaximum()
 o getMinimum()
 o getValue()
 o getValueIsAdjusting()
Returns true if the value is in the process of changing as a result of actions being taken by the user.
 o removeChangeListener(ChangeListener)
Removes a ChangeListener.
 o setExtent(int)
Sets the extent to n after ensuring that n is greater than or equal to zero and falls within the model's constraints:
 minimum <= value <= value+extent <= maximum
 
 o setMaximum(int)
Sets the maximum to n after ensuring that n that the other three properties obey the model's constraints:
 minimum <= value <= value+extent <= maximum
 
 o setMinimum(int)
Sets the minimum to n after ensuring that n that the other three properties obey the model's constraints:
 minimum <= value <= value+extent <= maximum
 
 o setRangeProperties(int, int, int, int, boolean)
Sets all of the BoundedRangeModel properties after forcing the arguments to obey the usual constraints:
 minimum <= value <= value+extent <= maximum
 

At most, one ChangeEvent is generated.

 o setValue(int)
Sets the value to n after ensuring that n falls within the model's constraints:
 minimum <= value <= value+extent <= maximum
 
 o setValueIsAdjusting(boolean)
Sets the valueIsAdjusting property.
 o toString()
Returns a string that displays all of the BoundedRangeModel properties.

Variables

 o changeEvent
 protected transient ChangeEvent changeEvent
Only one ChangeEvent is needed per model instance since the event's only (read-only) state is the source property. The source of events generated here is always "this".

 o listenerList
 protected EventListenerList listenerList

Constructors

 o DefaultBoundedRangeModel
 public DefaultBoundedRangeModel()
Initializes all of the properties as follows:

 o DefaultBoundedRangeModel
 public DefaultBoundedRangeModel(int value,
                                 int extent,
                                 int min,
                                 int max)
Initializes value, extent, minimum and maximum. Adjusting is false. Throws an IllegalArgumentException if the following constraints aren't satisfied:
 min <= value <= value+extent <= max
 

Methods

 o getValue
 public int getValue()
Returns:
the model's current value
See Also:
setValue, getValue
 o getExtent
 public int getExtent()
Returns:
the model's extent
See Also:
setExtent, getExtent
 o getMinimum
 public int getMinimum()
Returns:
the model's minimum
See Also:
setMinimum, getMinimum
 o getMaximum
 public int getMaximum()
Returns:
the model's maximum
See Also:
setMaximum, getMaximum
 o setValue
 public void setValue(int n)
Sets the value to n after ensuring that n falls within the model's constraints:
 minimum <= value <= value+extent <= maximum
 

See Also:
setValue
 o setExtent
 public void setExtent(int n)
Sets the extent to n after ensuring that n is greater than or equal to zero and falls within the model's constraints:
 minimum <= value <= value+extent <= maximum
 

See Also:
getExtent, setExtent
 o setMinimum
 public void setMinimum(int n)
Sets the minimum to n after ensuring that n that the other three properties obey the model's constraints:
 minimum <= value <= value+extent <= maximum
 

See Also:
getMinimum, setMinimum
 o setMaximum
 public void setMaximum(int n)
Sets the maximum to n after ensuring that n that the other three properties obey the model's constraints:
 minimum <= value <= value+extent <= maximum
 

See Also:
getMaximum, setMaximum
 o setValueIsAdjusting
 public void setValueIsAdjusting(boolean b)
Sets the valueIsAdjusting property.

See Also:
getValueIsAdjusting, setValue, setValueIsAdjusting
 o getValueIsAdjusting
 public boolean getValueIsAdjusting()
Returns true if the value is in the process of changing as a result of actions being taken by the user.

Returns:
the value of the valueIsAdjusting property
See Also:
setValueIsAdjusting, setValue, getValueIsAdjusting
 o setRangeProperties
 public void setRangeProperties(int newValue,
                                int newExtent,
                                int newMin,
                                int newMax,
                                boolean adjusting)
Sets all of the BoundedRangeModel properties after forcing the arguments to obey the usual constraints:
 minimum <= value <= value+extent <= maximum
 

At most, one ChangeEvent is generated.

See Also:
setRangeProperties, setValue, setExtent, setMinimum, setMaximum, setValueIsAdjusting
 o addChangeListener
 public void addChangeListener(ChangeListener l)
Adds a ChangeListener. The change listeners are run each time any one of the Bounded Range model properties changes.

Parameters:
l - the ChangeListener to add
See Also:
removeChangeListener, addChangeListener
 o removeChangeListener
 public void removeChangeListener(ChangeListener l)
Removes a ChangeListener.

Parameters:
l - the ChangeListener to remove
See Also:
addChangeListener, removeChangeListener
 o fireStateChanged
 protected void fireStateChanged()
Run each ChangeListeners stateChanged() method.

See Also:
setRangeProperties, EventListenerList
 o toString
 public String toString()
Returns a string that displays all of the BoundedRangeModel properties.

Overrides:
toString in class Object

All Packages  Class Hierarchy  This Package  Previous  Next  Index